<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function delConfirm() {
		var result = window.confirm('确认要删除该项吗？')
		return result;
	}
</script>
</head>
<body>
<table border="1px" align="center" width="70%" cellpadding="0" cellspacing="0">
	<tr align="center">
		<td>编号</td>
			<td>角色名称</td>
			<td>权限</td>
			<td>操作</td>
	</tr>
	<c:forEach var="role" items="${rolePage.roleList }" varStatus="rolestatus">
		<tr align="center">
			<td>${rolestatus.count }</td>
				<td>${role.roleName }</td>
				<td width="50%">
					<c:forEach var="function" items="${role.functionList }">
						${function.functionName }
					</c:forEach>
				</td>
				<td>
					<a href="${pageContext.request.contextPath }/servlet/updaterolepageservlet?id=${role.roleId}">更新</a>&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath }/servlet/delectroleservlet?id=${role.roleId}" onclick="return delConfirm()">删除</a>
				</td>
		</tr>
	</c:forEach>
	<tr>
			<td colspan='4' align='right'>共${rolePage.pageNum }页&nbsp;&nbsp;&nbsp;&nbsp; <a
				href='${pageContext.request.contextPath }/servlet/showroleservlet?currentPage=1'>首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showroleservlet?currentPage=${rolePage.prePage}'>上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				
				<c:forEach begin="1" end="${rolePage.pageNum }" var="page" >
					<a href='${pageContext.request.contextPath }/servlet/showroleservlet?currentPage=${page}'>${page}</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</c:forEach>
				

				<a href='${pageContext.request.contextPath }/servlet/showroleservlet?currentPage=${rolePage.nextPage}'>下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showroleservlet?currentPage=${rolePage.pageNum }'>尾页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
</table>
</body>
</html>